// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
// an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by google-apis-code-generator 1.5.1
//     C# generator version: 1.22.0
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

/**
 * \brief
 *   Prediction API Version v1.6
 *
 * \section ApiInfo API Version Information
 *    <table>
 *      <tr><th>API
 *          <td><a href='https://developers.google.com/prediction/docs/developer-guide'>Prediction API</a>
 *      <tr><th>API Version<td>v1.6
 *      <tr><th>API Rev<td>20160511 (496)
 *      <tr><th>API Docs
 *          <td><a href='https://developers.google.com/prediction/docs/developer-guide'>
 *              https://developers.google.com/prediction/docs/developer-guide</a>
 *      <tr><th>Discovery Name<td>prediction
 *    </table>
 *
 * \section ForMoreInfo For More Information
 *
 * The complete API documentation for using Prediction API can be found at
 * <a href='https://developers.google.com/prediction/docs/developer-guide'>https://developers.google.com/prediction/docs/developer-guide</a>.
 *
 * For more information about the Google APIs Client Library for .NET, see
 * <a href='https://developers.google.com/api-client-library/dotnet/get_started'>
 * https://developers.google.com/api-client-library/dotnet/get_started</a>
 */

namespace Google.Apis.Prediction.v1_6
{
    /// <summary>The Prediction Service.</summary>
    public class PredictionService : Google.Apis.Services.BaseClientService
    {
        /// <summary>The API version.</summary>
        public const string Version = "v1.6";

        /// <summary>The discovery version used to generate this service.</summary>
        public static Google.Apis.Discovery.DiscoveryVersion DiscoveryVersionUsed =
            Google.Apis.Discovery.DiscoveryVersion.Version_1_0;

        /// <summary>Constructs a new service.</summary>
        public PredictionService() :
            this(new Google.Apis.Services.BaseClientService.Initializer()) {}

        /// <summary>Constructs a new service.</summary>
        /// <param name="initializer">The service initializer.</param>
        public PredictionService(Google.Apis.Services.BaseClientService.Initializer initializer)
            : base(initializer)
        {
            hostedmodels = new HostedmodelsResource(this);
            trainedmodels = new TrainedmodelsResource(this);
        }

        /// <summary>Gets the service supported features.</summary>
        public override System.Collections.Generic.IList<string> Features
        {
            get { return new string[0]; }
        }

        /// <summary>Gets the service name.</summary>
        public override string Name
        {
            get { return "prediction"; }
        }

        /// <summary>Gets the service base URI.</summary>
        public override string BaseUri
        {
            get { return "https://www.googleapis.com/prediction/v1.6/projects/"; }
        }

        /// <summary>Gets the service base path.</summary>
        public override string BasePath
        {
            get { return "prediction/v1.6/projects/"; }
        }

        /// <summary>Available OAuth 2.0 scopes for use with the Prediction API.</summary>
        public class Scope
        {
            /// <summary>View and manage your data across Google Cloud Platform services</summary>
            public static string CloudPlatform = "https://www.googleapis.com/auth/cloud-platform";

            /// <summary>Manage your data and permissions in Google Cloud Storage</summary>
            public static string DevstorageFullControl = "https://www.googleapis.com/auth/devstorage.full_control";

            /// <summary>View your data in Google Cloud Storage</summary>
            public static string DevstorageReadOnly = "https://www.googleapis.com/auth/devstorage.read_only";

            /// <summary>Manage your data in Google Cloud Storage</summary>
            public static string DevstorageReadWrite = "https://www.googleapis.com/auth/devstorage.read_write";

            /// <summary>Manage your data in the Google Prediction API</summary>
            public static string Prediction = "https://www.googleapis.com/auth/prediction";

        }



        private readonly HostedmodelsResource hostedmodels;

        /// <summary>Gets the Hostedmodels resource.</summary>
        public virtual HostedmodelsResource Hostedmodels
        {
            get { return hostedmodels; }
        }

        private readonly TrainedmodelsResource trainedmodels;

        /// <summary>Gets the Trainedmodels resource.</summary>
        public virtual TrainedmodelsResource Trainedmodels
        {
            get { return trainedmodels; }
        }
    }

    ///<summary>A base abstract class for Prediction requests.</summary>
    public abstract class PredictionBaseServiceRequest<TResponse> : Google.Apis.Requests.ClientServiceRequest<TResponse>
    {
        ///<summary>Constructs a new PredictionBaseServiceRequest instance.</summary>
        protected PredictionBaseServiceRequest(Google.Apis.Services.IClientService service)
            : base(service)
        {
        }

        /// <summary>Data format for the response.</summary>
        /// [default: json]
        [Google.Apis.Util.RequestParameterAttribute("alt", Google.Apis.Util.RequestParameterType.Query)]
        public virtual System.Nullable<AltEnum> Alt { get; set; }

        /// <summary>Data format for the response.</summary>
        public enum AltEnum
        {
            /// <summary>Responses with Content-Type of application/json</summary>
            [Google.Apis.Util.StringValueAttribute("json")]
            Json,
        }

        /// <summary>Selector specifying which fields to include in a partial response.</summary>
        [Google.Apis.Util.RequestParameterAttribute("fields", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string Fields { get; set; }

        /// <summary>API key. Your API key identifies your project and provides you with API access, quota, and reports.
        /// Required unless you provide an OAuth 2.0 token.</summary>
        [Google.Apis.Util.RequestParameterAttribute("key", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string Key { get; set; }

        /// <summary>OAuth 2.0 token for the current user.</summary>
        [Google.Apis.Util.RequestParameterAttribute("oauth_token", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string OauthToken { get; set; }

        /// <summary>Returns response with indentations and line breaks.</summary>
        /// [default: true]
        [Google.Apis.Util.RequestParameterAttribute("prettyPrint", Google.Apis.Util.RequestParameterType.Query)]
        public virtual System.Nullable<bool> PrettyPrint { get; set; }

        /// <summary>Available to use for quota purposes for server-side applications. Can be any arbitrary string
        /// assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.</summary>
        [Google.Apis.Util.RequestParameterAttribute("quotaUser", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string QuotaUser { get; set; }

        /// <summary>IP address of the site where the request originates. Use this if you want to enforce per-user
        /// limits.</summary>
        [Google.Apis.Util.RequestParameterAttribute("userIp", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string UserIp { get; set; }

        /// <summary>Initializes Prediction parameter list.</summary>
        protected override void InitParameters()
        {
            base.InitParameters();

            RequestParameters.Add(
                "alt", new Google.Apis.Discovery.Parameter
                {
                    Name = "alt",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = "json",
                    Pattern = null,
                });
            RequestParameters.Add(
                "fields", new Google.Apis.Discovery.Parameter
                {
                    Name = "fields",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "key", new Google.Apis.Discovery.Parameter
                {
                    Name = "key",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "oauth_token", new Google.Apis.Discovery.Parameter
                {
                    Name = "oauth_token",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "prettyPrint", new Google.Apis.Discovery.Parameter
                {
                    Name = "prettyPrint",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = "true",
                    Pattern = null,
                });
            RequestParameters.Add(
                "quotaUser", new Google.Apis.Discovery.Parameter
                {
                    Name = "quotaUser",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "userIp", new Google.Apis.Discovery.Parameter
                {
                    Name = "userIp",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
        }
    }

    /// <summary>The "hostedmodels" collection of methods.</summary>
    public class HostedmodelsResource
    {
        private const string Resource = "hostedmodels";

        /// <summary>The service which this resource belongs to.</summary>
        private readonly Google.Apis.Services.IClientService service;

        /// <summary>Constructs a new resource.</summary>
        public HostedmodelsResource(Google.Apis.Services.IClientService service)
        {
            this.service = service;

        }


        /// <summary>Submit input and request an output against a hosted model.</summary>
        /// <param name="body">The body of the request.</param>
        /// <param name="project">The project associated with the model.</param>
        /// <param name="hostedModelName">The name
        /// of a hosted model.</param>
        public virtual PredictRequest Predict(Google.Apis.Prediction.v1_6.Data.Input body, string project, string hostedModelName)
        {
            return new PredictRequest(service, body, project, hostedModelName);
        }

        /// <summary>Submit input and request an output against a hosted model.</summary>
        public class PredictRequest : PredictionBaseServiceRequest<Google.Apis.Prediction.v1_6.Data.Output>
        {
            /// <summary>Constructs a new Predict request.</summary>
            public PredictRequest(Google.Apis.Services.IClientService service, Google.Apis.Prediction.v1_6.Data.Input body, string project, string hostedModelName)
                : base(service)
            {
                Project = project;
                HostedModelName = hostedModelName;
                Body = body;
                InitParameters();
            }


            /// <summary>The project associated with the model.</summary>
            [Google.Apis.Util.RequestParameterAttribute("project", Google.Apis.Util.RequestParameterType.Path)]
            public virtual string Project { get; private set; }

            /// <summary>The name of a hosted model.</summary>
            [Google.Apis.Util.RequestParameterAttribute("hostedModelName", Google.Apis.Util.RequestParameterType.Path)]
            public virtual string HostedModelName { get; private set; }


            /// <summary>Gets or sets the body of this request.</summary>
            Google.Apis.Prediction.v1_6.Data.Input Body { get; set; }

            ///<summary>Returns the body of the request.</summary>
            protected override object GetBody() { return Body; }

            ///<summary>Gets the method name.</summary>
            public override string MethodName
            {
                get { return "predict"; }
            }

            ///<summary>Gets the HTTP method.</summary>
            public override string HttpMethod
            {
                get { return "POST"; }
            }

            ///<summary>Gets the REST path.</summary>
            public override string RestPath
            {
                get { return "{project}/hostedmodels/{hostedModelName}/predict"; }
            }

            /// <summary>Initializes Predict parameter list.</summary>
            protected override void InitParameters()
            {
                base.InitParameters();

                RequestParameters.Add(
                    "project", new Google.Apis.Discovery.Parameter
                    {
                        Name = "project",
                        IsRequired = true,
                        ParameterType = "path",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "hostedModelName", new Google.Apis.Discovery.Parameter
                    {
                        Name = "hostedModelName",
                        IsRequired = true,
                        ParameterType = "path",
                        DefaultValue = null,
                        Pattern = null,
                    });
            }

        }
    }

    /// <summary>The "trainedmodels" collection of methods.</summary>
    public class TrainedmodelsResource
    {
        private const string Resource = "trainedmodels";

        /// <summary>The service which this resource belongs to.</summary>
        private readonly Google.Apis.Services.IClientService service;

        /// <summary>Constructs a new resource.</summary>
        public TrainedmodelsResource(Google.Apis.Services.IClientService service)
        {
            this.service = service;

        }


        /// <summary>Get analysis of the model and the data the model was trained on.</summary>
        /// <param name="project">The project associated with the model.</param>
        /// <param name="id">The unique name for
        /// the predictive model.</param>
        public virtual AnalyzeRequest Analyze(string project, string id)
        {
            return new AnalyzeRequest(service, project, id);
        }

        /// <summary>Get analysis of the model and the data the model was trained on.</summary>
        public class AnalyzeRequest : PredictionBaseServiceRequest<Google.Apis.Prediction.v1_6.Data.Analyze>
        {
            /// <summary>Constructs a new Analyze request.</summary>
            public AnalyzeRequest(Google.Apis.Services.IClientService service, string project, string id)
                : base(service)
            {
                Project = project;
                Id = id;
                InitParameters();
            }


            /// <summary>The project associated with the model.</summary>
            [Google.Apis.Util.RequestParameterAttribute("project", Google.Apis.Util.RequestParameterType.Path)]
            public virtual string Project { get; private set; }

            /// <summary>The unique name for the predictive model.</summary>
            [Google.Apis.Util.RequestParameterAttribute("id", Google.Apis.Util.RequestParameterType.Path)]
            public virtual string Id { get; private set; }


            ///<summary>Gets the method name.</summary>
            public override string MethodName
            {
                get { return "analyze"; }
            }

            ///<summary>Gets the HTTP method.</summary>
            public override string HttpMethod
            {
                get { return "GET"; }
            }

            ///<summary>Gets the REST path.</summary>
            public override string RestPath
            {
                get { return "{project}/trainedmodels/{id}/analyze"; }
            }

            /// <summary>Initializes Analyze parameter list.</summary>
            protected override void InitParameters()
            {
                base.InitParameters();

                RequestParameters.Add(
                    "project", new Google.Apis.Discovery.Parameter
                    {
                        Name = "project",
                        IsRequired = true,
                        ParameterType = "path",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "id", new Google.Apis.Discovery.Parameter
                    {
                        Name = "id",
                        IsRequired = true,
                        ParameterType = "path",
                        DefaultValue = null,
                        Pattern = null,
                    });
            }

        }

        /// <summary>Delete a trained model.</summary>
        /// <param name="project">The project associated with the model.</param>
        /// <param name="id">The unique name for
        /// the predictive model.</param>
        public virtual DeleteRequest Delete(string project, string id)
        {
            return new DeleteRequest(service, project, id);
        }

        /// <summary>Delete a trained model.</summary>
        public class DeleteRequest : PredictionBaseServiceRequest<string>
        {
            /// <summary>Constructs a new Delete request.</summary>
            public DeleteRequest(Google.Apis.Services.IClientService service, string project, string id)
                : base(service)
            {
                Project = project;
                Id = id;
                InitParameters();
            }


            /// <summary>The project associated with the model.</summary>
            [Google.Apis.Util.RequestParameterAttribute("project", Google.Apis.Util.RequestParameterType.Path)]
            public virtual string Project { get; private set; }

            /// <summary>The unique name for the predictive model.</summary>
            [Google.Apis.Util.RequestParameterAttribute("id", Google.Apis.Util.RequestParameterType.Path)]
            public virtual string Id { get; private set; }


            ///<summary>Gets the method name.</summary>
            public override string MethodName
            {
                get { return "delete"; }
            }

            ///<summary>Gets the HTTP method.</summary>
            public override string HttpMethod
            {
                get { return "DELETE"; }
            }

            ///<summary>Gets the REST path.</summary>
            public override string RestPath
            {
                get { return "{project}/trainedmodels/{id}"; }
            }

            /// <summary>Initializes Delete parameter list.</summary>
            protected override void InitParameters()
            {
                base.InitParameters();

                RequestParameters.Add(
                    "project", new Google.Apis.Discovery.Parameter
                    {
                        Name = "project",
                        IsRequired = true,
                        ParameterType = "path",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "id", new Google.Apis.Discovery.Parameter
                    {
                        Name = "id",
                        IsRequired = true,
                        ParameterType = "path",
                        DefaultValue = null,
                        Pattern = null,
                    });
            }

        }

        /// <summary>Check training status of your model.</summary>
        /// <param name="project">The project associated with the model.</param>
        /// <param name="id">The unique name for
        /// the predictive model.</param>
        public virtual GetRequest Get(string project, string id)
        {
            return new GetRequest(service, project, id);
        }

        /// <summary>Check training status of your model.</summary>
        public class GetRequest : PredictionBaseServiceRequest<Google.Apis.Prediction.v1_6.Data.Insert2>
        {
            /// <summary>Constructs a new Get request.</summary>
            public GetRequest(Google.Apis.Services.IClientService service, string project, string id)
                : base(service)
            {
                Project = project;
                Id = id;
                InitParameters();
            }


            /// <summary>The project associated with the model.</summary>
            [Google.Apis.Util.RequestParameterAttribute("project", Google.Apis.Util.RequestParameterType.Path)]
            public virtual string Project { get; private set; }

            /// <summary>The unique name for the predictive model.</summary>
            [Google.Apis.Util.RequestParameterAttribute("id", Google.Apis.Util.RequestParameterType.Path)]
            public virtual string Id { get; private set; }


            ///<summary>Gets the method name.</summary>
            public override string MethodName
            {
                get { return "get"; }
            }

            ///<summary>Gets the HTTP method.</summary>
            public override string HttpMethod
            {
                get { return "GET"; }
            }

            ///<summary>Gets the REST path.</summary>
            public override string RestPath
            {
                get { return "{project}/trainedmodels/{id}"; }
            }

            /// <summary>Initializes Get parameter list.</summary>
            protected override void InitParameters()
            {
                base.InitParameters();

                RequestParameters.Add(
                    "project", new Google.Apis.Discovery.Parameter
                    {
                        Name = "project",
                        IsRequired = true,
                        ParameterType = "path",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "id", new Google.Apis.Discovery.Parameter
                    {
                        Name = "id",
                        IsRequired = true,
                        ParameterType = "path",
                        DefaultValue = null,
                        Pattern = null,
                    });
            }

        }

        /// <summary>Train a Prediction API model.</summary>
        /// <param name="body">The body of the request.</param>
        /// <param name="project">The project associated with the model.</param>
        public virtual InsertRequest Insert(Google.Apis.Prediction.v1_6.Data.Insert body, string project)
        {
            return new InsertRequest(service, body, project);
        }

        /// <summary>Train a Prediction API model.</summary>
        public class InsertRequest : PredictionBaseServiceRequest<Google.Apis.Prediction.v1_6.Data.Insert2>
        {
            /// <summary>Constructs a new Insert request.</summary>
            public InsertRequest(Google.Apis.Services.IClientService service, Google.Apis.Prediction.v1_6.Data.Insert body, string project)
                : base(service)
            {
                Project = project;
                Body = body;
                InitParameters();
            }


            /// <summary>The project associated with the model.</summary>
            [Google.Apis.Util.RequestParameterAttribute("project", Google.Apis.Util.RequestParameterType.Path)]
            public virtual string Project { get; private set; }


            /// <summary>Gets or sets the body of this request.</summary>
            Google.Apis.Prediction.v1_6.Data.Insert Body { get; set; }

            ///<summary>Returns the body of the request.</summary>
            protected override object GetBody() { return Body; }

            ///<summary>Gets the method name.</summary>
            public override string MethodName
            {
                get { return "insert"; }
            }

            ///<summary>Gets the HTTP method.</summary>
            public override string HttpMethod
            {
                get { return "POST"; }
            }

            ///<summary>Gets the REST path.</summary>
            public override string RestPath
            {
                get { return "{project}/trainedmodels"; }
            }

            /// <summary>Initializes Insert parameter list.</summary>
            protected override void InitParameters()
            {
                base.InitParameters();

                RequestParameters.Add(
                    "project", new Google.Apis.Discovery.Parameter
                    {
                        Name = "project",
                        IsRequired = true,
                        ParameterType = "path",
                        DefaultValue = null,
                        Pattern = null,
                    });
            }

        }

        /// <summary>List available models.</summary>
        /// <param name="project">The project associated with the model.</param>
        public virtual ListRequest List(string project)
        {
            return new ListRequest(service, project);
        }

        /// <summary>List available models.</summary>
        public class ListRequest : PredictionBaseServiceRequest<Google.Apis.Prediction.v1_6.Data.List>
        {
            /// <summary>Constructs a new List request.</summary>
            public ListRequest(Google.Apis.Services.IClientService service, string project)
                : base(service)
            {
                Project = project;
                InitParameters();
            }


            /// <summary>The project associated with the model.</summary>
            [Google.Apis.Util.RequestParameterAttribute("project", Google.Apis.Util.RequestParameterType.Path)]
            public virtual string Project { get; private set; }

            /// <summary>Maximum number of results to return.</summary>
            /// [minimum: 0]
            [Google.Apis.Util.RequestParameterAttribute("maxResults", Google.Apis.Util.RequestParameterType.Query)]
            public virtual System.Nullable<long> MaxResults { get; set; }

            /// <summary>Pagination token.</summary>
            [Google.Apis.Util.RequestParameterAttribute("pageToken", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string PageToken { get; set; }


            ///<summary>Gets the method name.</summary>
            public override string MethodName
            {
                get { return "list"; }
            }

            ///<summary>Gets the HTTP method.</summary>
            public override string HttpMethod
            {
                get { return "GET"; }
            }

            ///<summary>Gets the REST path.</summary>
            public override string RestPath
            {
                get { return "{project}/trainedmodels/list"; }
            }

            /// <summary>Initializes List parameter list.</summary>
            protected override void InitParameters()
            {
                base.InitParameters();

                RequestParameters.Add(
                    "project", new Google.Apis.Discovery.Parameter
                    {
                        Name = "project",
                        IsRequired = true,
                        ParameterType = "path",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "maxResults", new Google.Apis.Discovery.Parameter
                    {
                        Name = "maxResults",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "pageToken", new Google.Apis.Discovery.Parameter
                    {
                        Name = "pageToken",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
            }

        }

        /// <summary>Submit model id and request a prediction.</summary>
        /// <param name="body">The body of the request.</param>
        /// <param name="project">The project associated with the model.</param>
        /// <param name="id">The unique name for
        /// the predictive model.</param>
        public virtual PredictRequest Predict(Google.Apis.Prediction.v1_6.Data.Input body, string project, string id)
        {
            return new PredictRequest(service, body, project, id);
        }

        /// <summary>Submit model id and request a prediction.</summary>
        public class PredictRequest : PredictionBaseServiceRequest<Google.Apis.Prediction.v1_6.Data.Output>
        {
            /// <summary>Constructs a new Predict request.</summary>
            public PredictRequest(Google.Apis.Services.IClientService service, Google.Apis.Prediction.v1_6.Data.Input body, string project, string id)
                : base(service)
            {
                Project = project;
                Id = id;
                Body = body;
                InitParameters();
            }


            /// <summary>The project associated with the model.</summary>
            [Google.Apis.Util.RequestParameterAttribute("project", Google.Apis.Util.RequestParameterType.Path)]
            public virtual string Project { get; private set; }

            /// <summary>The unique name for the predictive model.</summary>
            [Google.Apis.Util.RequestParameterAttribute("id", Google.Apis.Util.RequestParameterType.Path)]
            public virtual string Id { get; private set; }


            /// <summary>Gets or sets the body of this request.</summary>
            Google.Apis.Prediction.v1_6.Data.Input Body { get; set; }

            ///<summary>Returns the body of the request.</summary>
            protected override object GetBody() { return Body; }

            ///<summary>Gets the method name.</summary>
            public override string MethodName
            {
                get { return "predict"; }
            }

            ///<summary>Gets the HTTP method.</summary>
            public override string HttpMethod
            {
                get { return "POST"; }
            }

            ///<summary>Gets the REST path.</summary>
            public override string RestPath
            {
                get { return "{project}/trainedmodels/{id}/predict"; }
            }

            /// <summary>Initializes Predict parameter list.</summary>
            protected override void InitParameters()
            {
                base.InitParameters();

                RequestParameters.Add(
                    "project", new Google.Apis.Discovery.Parameter
                    {
                        Name = "project",
                        IsRequired = true,
                        ParameterType = "path",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "id", new Google.Apis.Discovery.Parameter
                    {
                        Name = "id",
                        IsRequired = true,
                        ParameterType = "path",
                        DefaultValue = null,
                        Pattern = null,
                    });
            }

        }

        /// <summary>Add new data to a trained model.</summary>
        /// <param name="body">The body of the request.</param>
        /// <param name="project">The project associated with the model.</param>
        /// <param name="id">The unique name for
        /// the predictive model.</param>
        public virtual UpdateRequest Update(Google.Apis.Prediction.v1_6.Data.Update body, string project, string id)
        {
            return new UpdateRequest(service, body, project, id);
        }

        /// <summary>Add new data to a trained model.</summary>
        public class UpdateRequest : PredictionBaseServiceRequest<Google.Apis.Prediction.v1_6.Data.Insert2>
        {
            /// <summary>Constructs a new Update request.</summary>
            public UpdateRequest(Google.Apis.Services.IClientService service, Google.Apis.Prediction.v1_6.Data.Update body, string project, string id)
                : base(service)
            {
                Project = project;
                Id = id;
                Body = body;
                InitParameters();
            }


            /// <summary>The project associated with the model.</summary>
            [Google.Apis.Util.RequestParameterAttribute("project", Google.Apis.Util.RequestParameterType.Path)]
            public virtual string Project { get; private set; }

            /// <summary>The unique name for the predictive model.</summary>
            [Google.Apis.Util.RequestParameterAttribute("id", Google.Apis.Util.RequestParameterType.Path)]
            public virtual string Id { get; private set; }


            /// <summary>Gets or sets the body of this request.</summary>
            Google.Apis.Prediction.v1_6.Data.Update Body { get; set; }

            ///<summary>Returns the body of the request.</summary>
            protected override object GetBody() { return Body; }

            ///<summary>Gets the method name.</summary>
            public override string MethodName
            {
                get { return "update"; }
            }

            ///<summary>Gets the HTTP method.</summary>
            public override string HttpMethod
            {
                get { return "PUT"; }
            }

            ///<summary>Gets the REST path.</summary>
            public override string RestPath
            {
                get { return "{project}/trainedmodels/{id}"; }
            }

            /// <summary>Initializes Update parameter list.</summary>
            protected override void InitParameters()
            {
                base.InitParameters();

                RequestParameters.Add(
                    "project", new Google.Apis.Discovery.Parameter
                    {
                        Name = "project",
                        IsRequired = true,
                        ParameterType = "path",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "id", new Google.Apis.Discovery.Parameter
                    {
                        Name = "id",
                        IsRequired = true,
                        ParameterType = "path",
                        DefaultValue = null,
                        Pattern = null,
                    });
            }

        }
    }
}

namespace Google.Apis.Prediction.v1_6.Data
{    

    public class Analyze : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Description of the data the model was trained on.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("dataDescription")]
        public virtual Analyze.DataDescriptionData DataDescription { get; set; } 

        /// <summary>List of errors with the data.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("errors")]
        public virtual System.Collections.Generic.IList<System.Collections.Generic.IDictionary<string,string>> Errors { get; set; } 

        /// <summary>The unique name for the predictive model.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("id")]
        public virtual string Id { get; set; } 

        /// <summary>What kind of resource this is.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("kind")]
        public virtual string Kind { get; set; } 

        /// <summary>Description of the model.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("modelDescription")]
        public virtual Analyze.ModelDescriptionData ModelDescription { get; set; } 

        /// <summary>A URL to re-request this resource.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("selfLink")]
        public virtual string SelfLink { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
        

        /// <summary>Description of the data the model was trained on.</summary>
        public class DataDescriptionData
        {
            /// <summary>Description of the input features in the data set.</summary>
            [Newtonsoft.Json.JsonPropertyAttribute("features")]
            public virtual System.Collections.Generic.IList<DataDescriptionData.FeaturesData> Features { get; set; } 

            /// <summary>Description of the output value or label.</summary>
            [Newtonsoft.Json.JsonPropertyAttribute("outputFeature")]
            public virtual DataDescriptionData.OutputFeatureData OutputFeature { get; set; } 

            

            public class FeaturesData
            {
                /// <summary>Description of the categorical values of this feature.</summary>
                [Newtonsoft.Json.JsonPropertyAttribute("categorical")]
                public virtual FeaturesData.CategoricalData Categorical { get; set; } 

                /// <summary>The feature index.</summary>
                [Newtonsoft.Json.JsonPropertyAttribute("index")]
                public virtual System.Nullable<long> Index { get; set; } 

                /// <summary>Description of the numeric values of this feature.</summary>
                [Newtonsoft.Json.JsonPropertyAttribute("numeric")]
                public virtual FeaturesData.NumericData Numeric { get; set; } 

                /// <summary>Description of multiple-word text values of this feature.</summary>
                [Newtonsoft.Json.JsonPropertyAttribute("text")]
                public virtual FeaturesData.TextData Text { get; set; } 

                

                /// <summary>Description of the categorical values of this feature.</summary>
                public class CategoricalData
                {
                    /// <summary>Number of categorical values for this feature in the data.</summary>
                    [Newtonsoft.Json.JsonPropertyAttribute("count")]
                    public virtual System.Nullable<long> Count { get; set; } 

                    /// <summary>List of all the categories for this feature in the data set.</summary>
                    [Newtonsoft.Json.JsonPropertyAttribute("values")]
                    public virtual System.Collections.Generic.IList<CategoricalData.ValuesData> Values { get; set; } 

                    

                    public class ValuesData
                    {
                        /// <summary>Number of times this feature had this value.</summary>
                        [Newtonsoft.Json.JsonPropertyAttribute("count")]
                        public virtual System.Nullable<long> Count { get; set; } 

                        /// <summary>The category name.</summary>
                        [Newtonsoft.Json.JsonPropertyAttribute("value")]
                        public virtual string Value { get; set; } 

                    }
                }    

                /// <summary>Description of the numeric values of this feature.</summary>
                public class NumericData
                {
                    /// <summary>Number of numeric values for this feature in the data set.</summary>
                    [Newtonsoft.Json.JsonPropertyAttribute("count")]
                    public virtual System.Nullable<long> Count { get; set; } 

                    /// <summary>Mean of the numeric values of this feature in the data set.</summary>
                    [Newtonsoft.Json.JsonPropertyAttribute("mean")]
                    public virtual string Mean { get; set; } 

                    /// <summary>Variance of the numeric values of this feature in the data set.</summary>
                    [Newtonsoft.Json.JsonPropertyAttribute("variance")]
                    public virtual string Variance { get; set; } 

                }    

                /// <summary>Description of multiple-word text values of this feature.</summary>
                public class TextData
                {
                    /// <summary>Number of multiple-word text values for this feature.</summary>
                    [Newtonsoft.Json.JsonPropertyAttribute("count")]
                    public virtual System.Nullable<long> Count { get; set; } 

                }
            }    

            /// <summary>Description of the output value or label.</summary>
            public class OutputFeatureData
            {
                /// <summary>Description of the output values in the data set.</summary>
                [Newtonsoft.Json.JsonPropertyAttribute("numeric")]
                public virtual OutputFeatureData.NumericData Numeric { get; set; } 

                /// <summary>Description of the output labels in the data set.</summary>
                [Newtonsoft.Json.JsonPropertyAttribute("text")]
                public virtual System.Collections.Generic.IList<OutputFeatureData.TextData> Text { get; set; } 

                

                /// <summary>Description of the output values in the data set.</summary>
                public class NumericData
                {
                    /// <summary>Number of numeric output values in the data set.</summary>
                    [Newtonsoft.Json.JsonPropertyAttribute("count")]
                    public virtual System.Nullable<long> Count { get; set; } 

                    /// <summary>Mean of the output values in the data set.</summary>
                    [Newtonsoft.Json.JsonPropertyAttribute("mean")]
                    public virtual string Mean { get; set; } 

                    /// <summary>Variance of the output values in the data set.</summary>
                    [Newtonsoft.Json.JsonPropertyAttribute("variance")]
                    public virtual string Variance { get; set; } 

                }    

                public class TextData
                {
                    /// <summary>Number of times the output label occurred in the data set.</summary>
                    [Newtonsoft.Json.JsonPropertyAttribute("count")]
                    public virtual System.Nullable<long> Count { get; set; } 

                    /// <summary>The output label.</summary>
                    [Newtonsoft.Json.JsonPropertyAttribute("value")]
                    public virtual string Value { get; set; } 

                }
            }
        }    

        /// <summary>Description of the model.</summary>
        public class ModelDescriptionData
        {
            /// <summary>An output confusion matrix. This shows an estimate for how this model will do in predictions.
            /// This is first indexed by the true class label. For each true class label, this provides a pair
            /// {predicted_label, count}, where count is the estimated number of times the model will predict the
            /// predicted label given the true label. Will not output if more then 100 classes (Categorical models
            /// only).</summary>
            [Newtonsoft.Json.JsonPropertyAttribute("confusionMatrix")]
            public virtual System.Collections.Generic.IDictionary<string,System.Collections.Generic.IDictionary<string,string>> ConfusionMatrix { get; set; } 

            /// <summary>A list of the confusion matrix row totals.</summary>
            [Newtonsoft.Json.JsonPropertyAttribute("confusionMatrixRowTotals")]
            public virtual System.Collections.Generic.IDictionary<string,string> ConfusionMatrixRowTotals { get; set; } 

            /// <summary>Basic information about the model.</summary>
            [Newtonsoft.Json.JsonPropertyAttribute("modelinfo")]
            public virtual Insert2 Modelinfo { get; set; } 

        }
    }    

    public class Input : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Input to the model for a prediction.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("input")]
        public virtual Input.InputData InputValue { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
        

        /// <summary>Input to the model for a prediction.</summary>
        public class InputData
        {
            /// <summary>A list of input features, these can be strings or doubles.</summary>
            [Newtonsoft.Json.JsonPropertyAttribute("csvInstance")]
            public virtual System.Collections.Generic.IList<object> CsvInstance { get; set; } 

        }
    }    

    public class Insert : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The unique name for the predictive model.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("id")]
        public virtual string Id { get; set; } 

        /// <summary>Type of predictive model (classification or regression).</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("modelType")]
        public virtual string ModelType { get; set; } 

        /// <summary>The Id of the model to be copied over.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("sourceModel")]
        public virtual string SourceModel { get; set; } 

        /// <summary>Google storage location of the training data file.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("storageDataLocation")]
        public virtual string StorageDataLocation { get; set; } 

        /// <summary>Google storage location of the preprocessing pmml file.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("storagePMMLLocation")]
        public virtual string StoragePMMLLocation { get; set; } 

        /// <summary>Google storage location of the pmml model file.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("storagePMMLModelLocation")]
        public virtual string StoragePMMLModelLocation { get; set; } 

        /// <summary>Instances to train model on.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("trainingInstances")]
        public virtual System.Collections.Generic.IList<Insert.TrainingInstancesData> TrainingInstances { get; set; } 

        /// <summary>A class weighting function, which allows the importance weights for class labels to be specified
        /// (Categorical models only).</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("utility")]
        public virtual System.Collections.Generic.IList<System.Collections.Generic.IDictionary<string,System.Nullable<double>>> Utility { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
        

        public class TrainingInstancesData
        {
            /// <summary>The input features for this instance.</summary>
            [Newtonsoft.Json.JsonPropertyAttribute("csvInstance")]
            public virtual System.Collections.Generic.IList<object> CsvInstance { get; set; } 

            /// <summary>The generic output value - could be regression or class label.</summary>
            [Newtonsoft.Json.JsonPropertyAttribute("output")]
            public virtual string Output { get; set; } 

        }
    }    

    public class Insert2 : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Insert time of the model (as a RFC 3339 timestamp).</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("created")]
        public virtual string CreatedRaw { get; set; }

        /// <summary><seealso cref="System.DateTime"/> representation of <see cref="CreatedRaw"/>.</summary>
        [Newtonsoft.Json.JsonIgnore]
        public virtual System.Nullable<System.DateTime> Created
        {
            get
            {
                return Google.Apis.Util.Utilities.GetDateTimeFromString(CreatedRaw);
            }
            set
            {
                CreatedRaw = Google.Apis.Util.Utilities.GetStringFromDateTime(value);
            }
        }

        /// <summary>The unique name for the predictive model.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("id")]
        public virtual string Id { get; set; } 

        /// <summary>What kind of resource this is.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("kind")]
        public virtual string Kind { get; set; } 

        /// <summary>Model metadata.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("modelInfo")]
        public virtual Insert2.ModelInfoData ModelInfo { get; set; } 

        /// <summary>Type of predictive model (CLASSIFICATION or REGRESSION).</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("modelType")]
        public virtual string ModelType { get; set; } 

        /// <summary>A URL to re-request this resource.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("selfLink")]
        public virtual string SelfLink { get; set; } 

        /// <summary>Google storage location of the training data file.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("storageDataLocation")]
        public virtual string StorageDataLocation { get; set; } 

        /// <summary>Google storage location of the preprocessing pmml file.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("storagePMMLLocation")]
        public virtual string StoragePMMLLocation { get; set; } 

        /// <summary>Google storage location of the pmml model file.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("storagePMMLModelLocation")]
        public virtual string StoragePMMLModelLocation { get; set; } 

        /// <summary>Training completion time (as a RFC 3339 timestamp).</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("trainingComplete")]
        public virtual string TrainingCompleteRaw { get; set; }

        /// <summary><seealso cref="System.DateTime"/> representation of <see cref="TrainingCompleteRaw"/>.</summary>
        [Newtonsoft.Json.JsonIgnore]
        public virtual System.Nullable<System.DateTime> TrainingComplete
        {
            get
            {
                return Google.Apis.Util.Utilities.GetDateTimeFromString(TrainingCompleteRaw);
            }
            set
            {
                TrainingCompleteRaw = Google.Apis.Util.Utilities.GetStringFromDateTime(value);
            }
        }

        /// <summary>The current status of the training job. This can be one of following: RUNNING; DONE; ERROR; ERROR:
        /// TRAINING JOB NOT FOUND</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("trainingStatus")]
        public virtual string TrainingStatus { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
        

        /// <summary>Model metadata.</summary>
        public class ModelInfoData
        {
            /// <summary>Estimated accuracy of model taking utility weights into account (Categorical models
            /// only).</summary>
            [Newtonsoft.Json.JsonPropertyAttribute("classWeightedAccuracy")]
            public virtual string ClassWeightedAccuracy { get; set; } 

            /// <summary>A number between 0.0 and 1.0, where 1.0 is 100% accurate. This is an estimate, based on the
            /// amount and quality of the training data, of the estimated prediction accuracy. You can use this is a
            /// guide to decide whether the results are accurate enough for your needs. This estimate will be more
            /// reliable if your real input data is similar to your training data (Categorical models only).</summary>
            [Newtonsoft.Json.JsonPropertyAttribute("classificationAccuracy")]
            public virtual string ClassificationAccuracy { get; set; } 

            /// <summary>An estimated mean squared error. The can be used to measure the quality of the predicted model
            /// (Regression models only).</summary>
            [Newtonsoft.Json.JsonPropertyAttribute("meanSquaredError")]
            public virtual string MeanSquaredError { get; set; } 

            /// <summary>Type of predictive model (CLASSIFICATION or REGRESSION).</summary>
            [Newtonsoft.Json.JsonPropertyAttribute("modelType")]
            public virtual string ModelType { get; set; } 

            /// <summary>Number of valid data instances used in the trained model.</summary>
            [Newtonsoft.Json.JsonPropertyAttribute("numberInstances")]
            public virtual System.Nullable<long> NumberInstances { get; set; } 

            /// <summary>Number of class labels in the trained model (Categorical models only).</summary>
            [Newtonsoft.Json.JsonPropertyAttribute("numberLabels")]
            public virtual System.Nullable<long> NumberLabels { get; set; } 

        }
    }    

    public class List : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>List of models.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("items")]
        public virtual System.Collections.Generic.IList<Insert2> Items { get; set; } 

        /// <summary>What kind of resource this is.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("kind")]
        public virtual string Kind { get; set; } 

        /// <summary>Pagination token to fetch the next page, if one exists.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("nextPageToken")]
        public virtual string NextPageToken { get; set; } 

        /// <summary>A URL to re-request this resource.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("selfLink")]
        public virtual string SelfLink { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    public class Output : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The unique name for the predictive model.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("id")]
        public virtual string Id { get; set; } 

        /// <summary>What kind of resource this is.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("kind")]
        public virtual string Kind { get; set; } 

        /// <summary>The most likely class label (Categorical models only).</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("outputLabel")]
        public virtual string OutputLabel { get; set; } 

        /// <summary>A list of class labels with their estimated probabilities (Categorical models only).</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("outputMulti")]
        public virtual System.Collections.Generic.IList<Output.OutputMultiData> OutputMulti { get; set; } 

        /// <summary>The estimated regression value (Regression models only).</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("outputValue")]
        public virtual string OutputValue { get; set; } 

        /// <summary>A URL to re-request this resource.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("selfLink")]
        public virtual string SelfLink { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
        

        public class OutputMultiData
        {
            /// <summary>The class label.</summary>
            [Newtonsoft.Json.JsonPropertyAttribute("label")]
            public virtual string Label { get; set; } 

            /// <summary>The probability of the class label.</summary>
            [Newtonsoft.Json.JsonPropertyAttribute("score")]
            public virtual string Score { get; set; } 

        }
    }    

    public class Update : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The input features for this instance.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("csvInstance")]
        public virtual System.Collections.Generic.IList<object> CsvInstance { get; set; } 

        /// <summary>The generic output value - could be regression or class label.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("output")]
        public virtual string Output { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }
}
